<?php


namespace app\api\controller;


use app\BaseController;
use edward\captcha\facade\CaptchaApi;
use think\middleware\AllowCrossDomain;

class ImageCaptcha extends BaseController
{
    protected $middleware=[AllowCrossDomain::class];
    public function index(){
        $data = CaptchaApi::create();
        unset($data['code']);
//        Array ( [base64] => data:image/png;base64 [key] => $2y$10$/chveN1c658K80CFdEmV6.eLgUYq.mM9UYiHAryXmGvCO0.zGnGM6 [code] => exgvh [md5] => c37ec5dd811e801ed7c7f5100c7c1fb4 )
        return $this->msg(1,'','',$data);
    }
}